<template>
  <div>
    <!-- <h1>主页</h1> -->
    <div class="index">
      <div class="nav">
        <ul>
          <li :class="{ con: flag == 0 }" @click="flag = 0">
            <span @click="$router.push('/index/recommend')">推荐</span>
          </li>

          <li :class="{ con: flag == 1 }" @click="flag = 1">
            <span @click="$router.push('/index/boysRec')">男生</span>
          </li>

          <li :class="{ con: flag == 2 }" @click="flag = 2">
            <span @click="$router.push('/index/girlsRec')">女生</span>
          </li>
        </ul>
      </div>
    </div>

    <div class="btm">
      <!-- 路由视图 -->
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: "home",
      flag: 0,
    };
  },
};
</script>

<style lang='less'>
.index {
  width: 100%;
  background-color: #fff;
  z-index: 1;
  position: fixed;
  top: 0;
  .nav {
    padding: 10px;
    display: flex;
    ul {
      display: flex;
      align-items: baseline;
      padding: 5px 0;
      flex: 1;
      text-align: center;
      li {
        width: 33.3333%;
        color: #aaa;
      }
      .con {
        font-size: 24px;
        color: #333;
      }
    }
  }
}
.btm {
  margin-top: 50px;
}
</style>